home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6965 < prev    next >
Encoding:
Text File  |  1996-08-05  |  914 b   |  35 lines

  1. Path: netaxs.com!usenet
  2. From: bobpez@netaxs.com (Bob Pesavento)
  3. Newsgroups: comp.lang.c++
  4. Subject: STL
  5. Date: 20 Feb 1996 22:10:40 GMT
  6. Organization: Net Access
  7. Message-ID: <4gdgt0$494@netaxs.com>
  8. NNTP-Posting-Host: wyndmoor1-45.slip.netaxs.com
  9. Mime-Version: 1.0
  10. X-Newsreader: WinVN 0.99.3
  11.  
  12. I'm a newbie with STL and not an expert at C++ so bear with me.  Assume a 
  13. simplified class:
  14.  
  15. class myclass
  16. {
  17.   int myint;
  18.   float myfloat;
  19.  
  20.   public:
  21.  
  22.  (the usual... constructors etc)
  23. };
  24.  
  25. I want use "list" and stuff a bunch of these in using push_back.  No 
  26. problem so far.  But I want the user to be able to select which item to 
  27. sort on... myint or myfloat.  What I have seen is that I can only set up 
  28. for one using the operator < and operator ==.  I don't want multiple 
  29. lists.  Can anyone give me an idea how to do this?  Your help will be 
  30. appreciated.
  31.  
  32. my e-mail addresses are:
  33. bobpez@netaxs.com  or  Bob@chiinc.com
  34.  
  35.